import { defHttp } from '/@/utils/http/axios';
import {  WebsitePartnerLinksModel, WebsitePartnerLinksTableRecordModel } from '../model/websitePartnerLinksModel';
import { ErrorMessageMode } from "/#/axios";

enum Api {
  WEBSITEPARTNERLINKS_PAGE = '/jxxhWebsite/websitePartnerLinks/getPartnerLinksVosPage',
  GET_WEBSITEPARTNERLINKSVO_BY_ID = '/jxxhWebsite/websitePartnerLinks/',
  WEBSITEPARTNERLINKSVO_SAVE = '/jxxhWebsite/websitePartnerLinks/save',
  WEBSITEPARTNERLINKSVO_UPDATE = '/jxxhWebsite/websitePartnerLinks/updateById',
  WEBSITEPARTNERLINKSVO_REMOVE = '/jxxhWebsite/websitePartnerLinks/logicalRemoveById/',
}

/**
 * @description: Get sample list value
 */

export const websitePartnerLinksListApi = (params: Object) =>
  defHttp.get<WebsitePartnerLinksTableRecordModel>(
    {url: Api.WEBSITEPARTNERLINKS_PAGE,params },
    { errorMessageMode: 'message' }
  );

export const getWebsitePartnerLinksVoByIdApi = (id) =>
  defHttp.get<WebsitePartnerLinksModel>(
    {url: Api.GET_WEBSITEPARTNERLINKSVO_BY_ID+id },
    { errorMessageMode: 'message' }
  );

export function websitePartnerLinksSaveApi(params: WebsitePartnerLinksModel, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<WebsitePartnerLinksModel>(
    {
      url: Api.WEBSITEPARTNERLINKSVO_SAVE,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function websitePartnerLinksUpdateApi(params: WebsitePartnerLinksModel, mode: ErrorMessageMode = 'modal') {
  return defHttp.put<WebsitePartnerLinksModel>(
    {
      url: Api.WEBSITEPARTNERLINKSVO_UPDATE,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export const logicalRemoveById = (id) =>
  defHttp.delete<WebsitePartnerLinksModel>(
    {url: Api.WEBSITEPARTNERLINKSVO_REMOVE+id },
    { errorMessageMode: 'message' }
  );
